package com.sumainfor.pc.market.controller.tenant;

import com.sumainfor.common.util.JsonResult;
import com.sumainfor.pc.market.service.tenant.TenantInformationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

/**
 * <p>
 *  合租人信息
 * <p>
 *
 * @author: zhoucong
 * @create: 2019-04-18 14:45
 **/
@Controller
@RequestMapping("/tenant/key/tenantInformation")
public class TenantInformationController {

    @Autowired
    TenantInformationService tenantInformationService;

    /**
    * <p>
    * 根据租客id查询合租人
    * </p>
    *
    * @author: zhoucong
    * @since:
    */
    @ResponseBody
    @PostMapping("/getTenantInformation")
    public JsonResult getTenantInformation(@RequestBody Map<String,Object> params){
        return tenantInformationService.getTenantInformation(params);
    }

    /**
    * <p>
    * 添加合租人
    * </p>
    *
    * @author: zhoucong
    * @since:
    */
    @ResponseBody
    @PostMapping("/insertTenantInformation")
    public JsonResult insertTenantInformation(@RequestBody Map<String,Object> params){
        return tenantInformationService.insertTf(params);
    }


    /**
    * <p>
    * 删除合租人
    * </p>
    *
    * @author: zhoucong
    * @since:
    */
    @ResponseBody
    @PostMapping("/deleteTenantInformation")
    public JsonResult deleteTenantInformation(@RequestBody Map<String,Object> params){
        return tenantInformationService.deleteTenantInformation(params);
    }

}
